#{extends 'common/base.html' /}
 
<!-- content start -->
<div class="admin-content">
	<div class="am-cf am-padding">
		<div class="am-fl am-cf">
			<strong class="am-text-primary am-text-lg">终端库存</strong> / <small>TerminalInventory</small>
		</div>
	</div>
	<div class="am-g">
		<div class="am-u-sm-12">
			<table class="am-table am-table-striped am-table-hover table-main">
				<thead>
					<tr>
						<th class="table-type">序号</th>
						<th class="table-type">终端编号</th>
						<th class="table-type">操作</th>
					</tr>
				</thead>
				<tbody>
					#{if json!=null} 
						#{set count:1/} 
						#{list items:json.data,as:'bean'}
							<tr>
								<td>${count}</td>
								<td>${bean?.terminal_id}</td>
								<td>
								 	<button onclick="goUrl('@{terminal.TermialInventoryAction.inventoryDetails}?tid=${bean?.terminal_id}')"
															class="am-btn am-btn-default am-btn-xs am-text-secondary">
															<span class="am-icon-pencil-square-o"></span> 查看库存详情
									</button>
								</td>
							</tr>
							#{set count:count+1/}
						#{/list} 
					#{/if}
				</tbody>
			</table>
		</div>
		<div class="am-u-sm-12">
			<table class="am-table am-table-striped am-table-hover table-main">
				<thead>
					<tr>
						<th class="table-type">序号</th>
						<th class="table-type">规格</th>
						<th class="table-type">当前库存</th>
						<th class="tabl+e-type">安全库存</th>
					</tr>
				</thead>
				<tbody>
					#{if listSafe!=null} 
						#{set count:1/} 
						#{list items:listSafe,as:'bean'}
							<tr>
								<td>${count}</td>
								<td>${bean?.cutter_specs}</td>
								<td>
								#{if bean?.num>=bean?.safeNum}
										<span style="color:green">${bean?.num}</span>
								#{/if}
								#{else}
									<span style="color:red">${bean?.num}</span>
								#{/else}
								</td>
								
								<td>${bean?.safeNum}</td>
							</tr>
							#{set count:count+1/}
						#{/list} 
					#{/if}
				</tbody>
			</table>
		</div>
	</div>
 
 </div>
<!-- content end -->